import 'package:flutter/material.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
import 'package:get/get.dart';

import 'home_logic.dart';
import 'home_state.dart';

/// @description:
/// @author
/// @date: 2021/07/06 17:16:15
class HomePage extends StatelessWidget {
  final HomeLogic logic = Get.put(HomeLogic());
  final HomeState state = Get.find<HomeLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(actions: <Widget>[
        IconButton(
          icon: Icon(Icons.search),
          tooltip: "搜索",
          onPressed: () {
            print("搜索");
          },
        ),
        IconButton(
          icon: Icon(Icons.crop_free),
          tooltip: "扫一扫",
          onPressed: () {
            print("扫一扫");
          },
        ),
      ], automaticallyImplyLeading: false),
      body: SingleChildScrollView(
        child: Container(
          margin: EdgeInsets.only(top: 10.0),
          height: 188,
          // child: new Swiper(
          //   itemHeight: 188,
          //   itemBuilder: (BuildContext context, int index) {
          //     return ClipRRect(
          //       borderRadius: BorderRadius.circular(20),
          //       child: Image.network(
          //         "http://via.placeholder.com/288x188",
          //         width: 288,
          //         height: 188,
          //         fit: BoxFit.cover,
          //       ),
          //     );
          //   },
          //   itemCount: 10,
          //   viewportFraction: 0.7,
          //   scale: 0.8,
          // ),
        ),
      ),
    );
  }
}
